<?
  include('../init.php');

  $news_id= $_GET["aid"];
  $sql = "SELECT news_img FROM news_promotion WHERE news_id = '".$news_id."'";
  $line = $db->queryUniqueObject($sql);
  
  $db->execute("DELETE FROM news_promotion WHERE news_id = '$news_id'");
  
  if(file_exists('../../images/news-promotion/'.$line->news_img)){
    unlink('../../images/news-promotion/'.$line->news_img);
  }

  header("Location:index.php");
?>